﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERPStore.Web.ModelMetadata
{
	public class RegistrationUserMetadataDefinition : ModelMetadataDefinition<ERPStore.Models.RegistrationUser>
	{
		public RegistrationUserMetadataDefinition()
		{
			SetMetadataFor(p => p.LastName).Required(errorMessage:"vous devez indiquer votre nom")
				.DisplayName("Nom")
				.Watermark("nom de famille");

			SetMetadataFor(p => p.FirstName).Required();
			SetMetadataFor(p => p.Email).Required();
			// SetMetadataFor(p => p.PhoneNumber).Required();

			// SetMetadataFor(p => p.BillingAddressCity).RequiredWhen(p => !p.IsSameBillingAddress);
			// SetMetadataFor(p => p.BillingAddressCountryId).IsRequired();
			// SetMetadataFor(p => p.BillingAddressRecipientName).IsRequired();
			// SetMetadataFor(p => p.BillingAddressStreet).IsRequired();
			// SetMetadataFor(p => p.BillingAddressZipCode).IsRequired().MaxStringLength(6).MinStringLength(5);

			// SetMetadataFor(p => p.CorporatePhoneNumber).IsRequired();

			SetMetadataFor(p => p.ShippingAddressCity).Required();
			SetMetadataFor(p => p.ShippingAddressCountryId).Required();
			SetMetadataFor(p => p.ShippingAddressRecipientName).Required();
			SetMetadataFor(p => p.ShippingAddressStreet).Required();
			SetMetadataFor(p => p.ShippingAddressZipCode).Required().MaxStringLength(6).MinStringLength(5);
		}
	}
}
